package cn.xspace.module.other.activity;

import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;

import com.xspace.android.xafcommon.base.BaseActivity;

import cn.xspace.app.view.TitleBar;
import cn.xspace.module.other.R;
import cn.xspace.module.other.adapter.SearchAdapter;

public class SearchAct extends BaseActivity implements View.OnClickListener {

    private TitleBar mSettingTitleBar;
    private EditText mSearchEt;
    private TextView mSearchTvCancel;
    private ListView mSearchListview;
    private LinearLayout mActivitySearch;


    @Override
    protected void initView() {
        setContentView(R.layout.activity_search);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initFindViewById() {
        mSettingTitleBar = (TitleBar) findViewById(R.id.setting_title_bar);
        mSearchEt = (EditText) findViewById(R.id.search_et);
        mSearchTvCancel = (TextView) findViewById(R.id.search_tv_cancel);
        mSearchListview = (ListView) findViewById(R.id.search_listview);
        mActivitySearch = (LinearLayout) findViewById(R.id.activity_search);
    }

    @Override
    protected void initEvent() {
        mSettingTitleBar.setLeftLayoutClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        mSettingTitleBar.setRightLayoutClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        mSearchTvCancel.setOnClickListener(this);
        mSearchListview.setAdapter(new SearchAdapter(this));
    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.search_tv_cancel) {
            finish();
        }
    }
}
